package demo3;
class A{
    //与子类中重名(不重参)的fun方法构成重载
    protected void fun(){
        System.out.println("demo3包中的父类不带参数的fun()成员方法");
    }
}

class B extends A {
    public String name;
    public int age;

    public void fun(int x){
        System.out.println("子类的带一个参数的fun()成员方法");
    }

    @Override
    public void fun() {
        super.fun();
    }
}
public class javaTest {
    public static void main(String[] args) {
        B b=new B();
        b.fun();
        b.fun(44);
    }
}
